﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Tanks
{
    public abstract class IFieldObject
    {
        protected Game1 game;
        protected Microsoft.Xna.Framework.Vector2 position;
        protected float rotation;
        protected Texture2D texture;
        protected Texture2D textureDead;
        private PropertiesObject properties;

        public PropertiesObject Properties
        {
            get { return properties; }
            set { properties = value; }
        }


        public IFieldObject(Game1 game, PropertiesObject properties, Texture2D texture)
        {
            this.texture = texture;            
            this.game = game;
            this.properties = properties;
            position = new Vector2(0, 0);
            rotation = 0;
        }
        public Microsoft.Xna.Framework.Graphics.Texture2D GetTexture()
        {
            return texture;
        }
        public Microsoft.Xna.Framework.Vector2 GetPosition()
        {
            return position;
        }
        //вспомогательный метод. TODO:удалить
        public void setPosition(Microsoft.Xna.Framework.Vector2 pos)
        {
            position = new Vector2(pos.X, pos.Y);
        }

        abstract public void Update(GameTime gameTime);
        abstract public void Draw(); 
        abstract public Vector2 getActualPosition();
        abstract public float getActualRotation();
        abstract public Vector2[] getActualBoards();
        abstract public Vector2[] getBoards();
        abstract public void collisionRotNotFounded();//колизии после поворота не надены!
        abstract public void collisionNotFounded();//коллизии не найдены!
        abstract public void collisionFounded(IFieldObject two);
    }
}
